package com.thiswhyme.sentinel.server2.handler;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.thiswhyme.common.response.ResponseVo;

/**
 * @description: block处理，参数需要和源方法参数一致，可多加一个BlockException
 * @author: thiswhyme
 * @date: 2020/9/3
 */
public class BizBlockHandler {

    public static ResponseVo<String> queryUserNameBlockHandle(Integer userId, BlockException e) {
        e.printStackTrace();
        return ResponseVo.failure("403", String.format("queryUserName限流处理, userId：%s, errMsg: %s", userId, e.getMessage()));
    }
}
